<admintpl file="header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:U('Realuser/index')}">注册用户</a></li>
			<li class="active"><a href="{:U('Realuser/prizelist')}">中奖用户</a></li>
		</ul>
		<form class="well form-search js-ajax-form" method="post" action="{:U('Realuser/prizelist')}">
			活动：
			<select class="select_2" name="event_id" style="width: 120px;">
				<option value='0'>全部</option>
				<foreach name="events" item="event">
					<option <if condition="I('param.event_id') eq $event['id']" >selected</if> value="{$event.id}">{$event.event_name}</option>
				</foreach>
			</select>
			类型：
			<select class="select_2" name="card_type" style="width:100px;">
				<option value='0'>全部</option>
				<foreach name="prize_type" item="vo">
					<option <if condition="I('param.card_type') eq $vo['id']" >selected</if> value="{$vo.id}">{$vo.name}</option>
				</foreach>
			</select>
			状态：
			<select class="select_2" name="order_status" style="width:100px;">
				<option value='0'>全部</option>
				<foreach name="ostatus" item="vo">
					<option <if condition="I('param.order_status') eq $vo['id']" >selected</if> value="{$vo.id}">{$vo.name}</option>
				</foreach>
			</select>
			中奖时间：
            <input type="text" name="start_time" class="js-date" value="{:I('param.start_time')}" style="width:90px;" autocomplete="off">-
            <input type="text" name="end_time" class="js-date"  value="{:I('param.end_time')}" style="width:90px;" autocomplete="off"> &nbsp; &nbsp;

            <input type="submit" class="btn btn-primary" value="搜索" />
            <if condition="$count">共查询到 {$count} 条数据 </if>
        	<button class="btn btn-primary js-ajax-submit" type="submit" data-action="{:U('Realuser/prizeoutcsv')}">查询导出</button>
        </form>
		<form method="post" class="js-ajax-form">
			<div class="pagination">{$page}</div>
			<table class="table table-hover table-bordered">
				<thead>
					<tr>
						<th>ID</th>
                        <th width="40">头像</th>
						<th>用户名/昵称</th>
                        <th>电话/地址</th>
						<th>中奖类型</th>
						<th>活动</th>
                        <th>物料</th>
                        <th>物料号码</th>
						<th>中奖时间</th>
                        <th>状态</th>
					</tr>
				</thead>
				<tbody>
					<foreach name="lists" item="vo">
						<tr>
						<foreach name="users" item="user">
							<if condition="$user['weixin_id'] eq $vo['openid']">
							<td>{$vo.id}</td>
	                        <td style="padding: 0;margin: 0;"><if condition="$user['weixin_avatar']"><img src="{$user['weixin_avatar']}"/></if></td>
							<td>{$user.realname}<br>{$user.nickname}</td>
	                        <td>{$user.phone}<br>{$user.address}</td>
							<td>{$prize_type[$vo['card_type']-1]['name']}</td>
							<td>
								<foreach name="events" item="event">
									<if condition="$event['id'] eq $vo['event_id']">{$event.event_name}</if>
								</foreach>
							</td>
	                        <td>
								<foreach name="cards" item="card">
									<if condition="$card['id'] eq $vo['card_id']">{$card.card_name}</if>
								</foreach>
	                        </td>
							<td>{$vo.card_num}</td>
							<td>{$vo.winning_time}</td>
	                        <td>{$ostatus[$vo['order_status']]['name']}</td>
							</if>
						</foreach>
						</tr>
					</foreach>
				</tbody>
				<thead>
					<tr>
						<th>ID</th>
                        <th width="40">头像</th>
						<th>用户名/昵称</th>
                        <th>电话/地址</th>
						<th>中奖类型</th>
						<th>活动</th>
                        <th>物料</th>
                        <th>物料号码</th>
						<th>中奖时间</th>
                        <th>状态</th>
					</tr>
				</thead>
			</table>
			<div class="pagination">{$page}</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
</body>
</html>
